package rs.ac.uns.ftn.informatika.mbs2.e11031.etaksi.entitet;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.NamedQuery;

@SuppressWarnings("serial")
@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
@NamedQuery(name = "nadjiKorisnikaSaKorisnickimImenomILozinkom", query = "select k from Korisnik k where k.korisnickoIme = :korisnickoIme and k.lozinka = :lozinka")
public abstract class Korisnik implements Serializable {

	@Id
	@GeneratedValue(strategy = GenerationType.TABLE)
	@Column(name = "ko_id")
	protected Integer id;

	@Column(name = "ko_jmbg", nullable = false)
	protected Long jmbg;

	@Column(name = "ko_ime", nullable = false)
	protected String ime;

	@Column(name = "ko_prezime", nullable = false)
	protected String prezime;

	@Column(name = "ko_korisnicko_ime", nullable = false)
	protected String korisnickoIme;

	@Column(name = "ko_lozinka", nullable = false)
	protected String lozinka;

	public Korisnik() {
		super();
	}

	public Korisnik(long jmbg, String ime, String prezime,
			String korisnickoIme, String lozinka) {
		super();
		this.jmbg = jmbg;
		this.ime = ime;
		this.prezime = prezime;
		this.korisnickoIme = korisnickoIme;
		this.lozinka = lozinka;
	}

	public Long getJmbg() {
		return jmbg;
	}

	public void setJmbg(Long jmbg) {
		this.jmbg = jmbg;
	}

	public String getIme() {
		return ime;
	}

	public void setIme(String ime) {
		this.ime = ime;
	}

	public String getPrezime() {
		return prezime;
	}

	public void setPrezime(String prezime) {
		this.prezime = prezime;
	}

	public String getKorisnickoIme() {
		return korisnickoIme;
	}

	public void setKorisnickoIme(String korisnickoIme) {
		this.korisnickoIme = korisnickoIme;
	}

	public String getLozinka() {
		return lozinka;
	}

	public void setLozinka(String lozinka) {
		this.lozinka = lozinka;
	}

	public Integer getId() {
		return id;
	}

	@Override
	public String toString() {
		return "Korisnik [id=" + id + ", jmbg=" + jmbg + ", ime=" + ime
				+ ", prezime=" + prezime + ", korisnickoIme=" + korisnickoIme
				+ ", lozinka=" + lozinka + "]";
	}

}
